.class public Lcom/nemustech/regina/SecretAppSelector$SecretAppAdapter;
.super Landroid/widget/ArrayAdapter;
.source "SecretAppSelector.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/nemustech/regina/SecretAppSelector;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x4
    name = "SecretAppAdapter"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/widget/ArrayAdapter",
        "<",
        "Lcom/nemustech/regina/SecretAppSelector$SecretAppDataSet;",
        ">;"
    }
.end annotation


# instance fields
.field private context:Lcom/nemustech/regina/SecretAppSelector;

.field private items:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/nemustech/regina/SecretAppSelector$SecretAppDataSet;",
            ">;"
        }
    .end annotation
.end field

.field final synthetic this$0:Lcom/nemustech/regina/SecretAppSelector;


# direct methods
.method public constructor <init>(Lcom/nemustech/regina/SecretAppSelector;Landroid/content/Context;ILjava/util/List;)V
    .locals 0
    .parameter
    .parameter "context"
    .parameter "textViewResourceId"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "I",
            "Ljava/util/List",
            "<",
            "Lcom/nemustech/regina/SecretAppSelector$SecretAppDataSet;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 221
    .local p4, list:Ljava/util/List;,"Ljava/util/List<Lcom/nemustech/regina/SecretAppSelector$SecretAppDataSet;>;"
    iput-object p1, p0, Lcom/nemustech/regina/SecretAppSelector$SecretAppAdapter;->this$0:Lcom/nemustech/regina/SecretAppSelector;

    .line 222
    invoke-direct {p0, p2, p3, p4}, Landroid/widget/ArrayAdapter;-><init>(Landroid/content/Context;ILjava/util/List;)V

    .line 224
    check-cast p2, Lcom/nemustech/regina/SecretAppSelector;

    .end local p2
    iput-object p2, p0, Lcom/nemustech/regina/SecretAppSelector$SecretAppAdapter;->context:Lcom/nemustech/regina/SecretAppSelector;

    .line 225
    iput-object p4, p0, Lcom/nemustech/regina/SecretAppSelector$SecretAppAdapter;->items:Ljava/util/List;

    .line 227
    return-void
.end method


# virtual methods
.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 10
    .parameter "position"
    .parameter "convertView"
    .parameter "parent"

    .prologue
    const v9, 0x7f09002b

    const v8, 0x7f09002a

    .line 232
    move-object v3, p2

    .line 233
    .local v3, v:Landroid/view/View;
    if-nez v3, :cond_0

    .line 234
    iget-object v5, p0, Lcom/nemustech/regina/SecretAppSelector$SecretAppAdapter;->context:Lcom/nemustech/regina/SecretAppSelector;

    const-string v6, "layout_inflater"

    invoke-virtual {v5, v6}, Lcom/nemustech/regina/SecretAppSelector;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Landroid/view/LayoutInflater;

    .line 235
    .local v4, vi:Landroid/view/LayoutInflater;
    const v5, 0x7f03000e

    const/4 v6, 0x0

    invoke-virtual {v4, v5, v6}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v3

    .line 238
    .end local v4           #vi:Landroid/view/LayoutInflater;
    :cond_0
    iget-object v5, p0, Lcom/nemustech/regina/SecretAppSelector$SecretAppAdapter;->items:Ljava/util/List;

    invoke-interface {v5, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lcom/nemustech/regina/SecretAppSelector$SecretAppDataSet;

    .line 240
    .local v2, set:Lcom/nemustech/regina/SecretAppSelector$SecretAppDataSet;
    const/4 v1, 0x0

    .line 242
    .local v1, info:Landroid/content/pm/ActivityInfo;
    :try_start_0
    iget-object v5, p0, Lcom/nemustech/regina/SecretAppSelector$SecretAppAdapter;->this$0:Lcom/nemustech/regina/SecretAppSelector;

    invoke-static {v5}, Lcom/nemustech/regina/SecretAppSelector;->access$300(Lcom/nemustech/regina/SecretAppSelector;)Landroid/content/pm/PackageManager;

    move-result-object v5

    invoke-virtual {v2}, Lcom/nemustech/regina/SecretAppSelector$SecretAppDataSet;->getComponentName()Landroid/content/ComponentName;

    move-result-object v6

    const/16 v7, 0x80

    invoke-virtual {v5, v6, v7}, Landroid/content/pm/PackageManager;->getActivityInfo(Landroid/content/ComponentName;I)Landroid/content/pm/ActivityInfo;

    move-result-object v1

    .line 243
    const v5, 0x7f09002a

    invoke-virtual {v3, v5}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v5

    check-cast v5, Landroid/widget/ImageView;

    iget-object v6, p0, Lcom/nemustech/regina/SecretAppSelector$SecretAppAdapter;->this$0:Lcom/nemustech/regina/SecretAppSelector;

    invoke-static {v6}, Lcom/nemustech/regina/SecretAppSelector;->access$300(Lcom/nemustech/regina/SecretAppSelector;)Landroid/content/pm/PackageManager;

    move-result-object v6

    invoke-virtual {v1, v6}, Landroid/content/pm/ActivityInfo;->loadIcon(Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;

    move-result-object v6

    invoke-virtual {v5, v6}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    .line 244
    const v5, 0x7f09002b

    invoke-virtual {v3, v5}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v5

    check-cast v5, Landroid/widget/TextView;

    iget-object v6, p0, Lcom/nemustech/regina/SecretAppSelector$SecretAppAdapter;->this$0:Lcom/nemustech/regina/SecretAppSelector;

    invoke-static {v6}, Lcom/nemustech/regina/SecretAppSelector;->access$300(Lcom/nemustech/regina/SecretAppSelector;)Landroid/content/pm/PackageManager;

    move-result-object v6

    invoke-virtual {v1, v6}, Landroid/content/pm/ActivityInfo;->loadLabel(Landroid/content/pm/PackageManager;)Ljava/lang/CharSequence;

    move-result-object v6

    invoke-virtual {v5, v6}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 245
    const v5, 0x7f09002c

    invoke-virtual {v3, v5}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p0

    .end local p0
    check-cast p0, Landroid/widget/CheckBox;

    invoke-virtual {v2}, Lcom/nemustech/regina/SecretAppSelector$SecretAppDataSet;->isHidden()Z

    move-result v5

    invoke-virtual {p0, v5}, Landroid/widget/CheckBox;->setChecked(Z)V
    :try_end_0
    .catch Landroid/content/pm/PackageManager$NameNotFoundException; {:try_start_0 .. :try_end_0} :catch_0

    .line 252
    :goto_0
    return-object v3

    .line 246
    :catch_0
    move-exception v5

    move-object v0, v5

    .line 248
    .local v0, e2:Landroid/content/pm/PackageManager$NameNotFoundException;
    invoke-virtual {v0}, Landroid/content/pm/PackageManager$NameNotFoundException;->printStackTrace()V

    .line 249
    invoke-virtual {v3, v8}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p0

    check-cast p0, Landroid/widget/ImageView;

    const v5, 0x7f02004e

    invoke-virtual {p0, v5}, Landroid/widget/ImageView;->setImageResource(I)V

    .line 250
    invoke-virtual {v3, v9}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p0

    check-cast p0, Landroid/widget/TextView;

    const-string v5, "Unkwown"

    invoke-virtual {p0, v5}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    goto :goto_0
.end method
